package com.yonyou.brigade.order_center.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.service.IService;
import com.yonyou.brigade.order_center.model.BriTrainOrder;
import com.yonyou.brigade.order_center.model.BriTrainOrderDO;
import com.yonyou.brigade.order_center.model.CnvTrainOrderDO;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author jiangzhf@yonyou.com
 * @since 2018-06-14
 */
public interface IBriTrainOrderService extends IService<BriTrainOrder> {

    List<BriTrainOrderDO> getBriTrainOrderDOs(Map params);

    List<BriTrainOrder> getBriTrainOrder(Map params);

    public void updateIsBxStateByOrderIds(List<Integer> ids,int bxState);

    List<CnvTrainOrderDO> getCnvTrainOrderDos(Map<String, String> params, Date beginDate, Date endDate);

    public List<BriTrainOrder> getOrdersByRelateYBZId(List<String> ybzIds);

    void updateIsNoteByOrderId(int orderId);

    List<BriTrainOrder> getOrdersByTimeRange(String tenantId, Date begin, Date end);

    JSONObject getTrainOrderJson(JSONObject params);

    /**
     * 获取火车订单详情
     * @param tenant
     * @param orderNo
     * @return
     */
    BriTrainOrder getTrainOrderJson(String tenant, String orderNo);

    CnvTrainOrderDO getBriTrainOrderByOrderNo(String orderNo);

    /**
     * 根据订单号获取订单
     * @param orderNo
     * @param fromType
     * @return
     */
    List<CnvTrainOrderDO> getOrderLikeOrderNo(String orderNo, String fromType, String tenant);
    /**
     * 查询原单或退改单
     * @param orderNo
     * @param parentNo
     * @param fromType
     * @return
     */
    List<CnvTrainOrderDO> getRelationOrders(String orderNo, String parentNo, String fromType, String tenant);

    /**
     * 查询原单或退改单
     * @param orderNo
     * @param parentNo
     * @param fromType
     * @return
     */
    List<BriTrainOrder> getRelationOrdersV2(String orderNo, String parentNo, String fromType, String tenant);

    JSONArray getTrainOrders(String userId, String bxState, String beginDate, String endDate, String tenant, Map<String, List<Map<String, String>>> canBeSeen);

    JSONArray getTrainOrders(String tenant, String orderNo);

    List<BriTrainOrder> getTrainOrdersByBxState(String userId, String bxState, String beginDate, String endDate, String tenant, Map<String, List<Map<String, String>>> canBeSeen);
}
